<template>
    <div class="register">
        <div class="title">注册页</div>
        <div class="block">
        
            <input type="text" placeholder="输入手机号" v-model="form.phone">
        </div>
        <div class="block">
            <input type="password" placeholder="输入密码"  v-model="form.pass">
        </div>
        <div class="block">
            <input type="button" value="注册" @click="toregister()">
        </div>
    </div>
  </template>
  
  <script>
  import {user_register} from '../api/api'
  export default {
    name: 'register',
    data(){
      return{
        list:[
        ],
         form:{phone:'',pass:''}
      }
      },
      methods:{
        toregister(){
         user_register({phone:this.form.phone,pass:this.form.pass}).then((res)=>{
           console.log(res.data);
        })
      },
   
      }
     
  }
  </script>
  
  <!-- Add "scoped" attribute to limit CSS to this component only -->
  <style scoped>
   *{
            margin: 0;
            padding: 0;
        }
        .title{
            line-height: 40px;
            text-align: center;
            margin: 50px 0;
        }
        .block{
            margin: 30px;
        }
        .block input{
            height: 40px;
            line-height: 40px;
            border: 1px solid #ccc;
            padding-left: 20px;
            border-radius: 5px;
            width: 100%;
            box-sizing: border-box;
        }
  </style>
  